#ifndef _XSTDUSB_INCLUDE_XSTDUSB_H_
#define _XSTDUSB_INCLUDE_XSTDUSB_H_
#include "xconfig.h"
#include "xusb_common.h"
#include "xusbdevice.h"

XUDC_API_BEGIN

void APICALL XSTDUSB_API_PREFIX(version)(int *major, int *minor, int *build);

int APICALL XSTDUSB_API_PREFIX(enumdevice)(int vid, int pid, TXUSBDevice deviceList[], int maxCout);

int APICALL XSTDUSB_API_PREFIX(searchdevice)(unsigned short vid, unsigned short pid, char *szSerialNumber, PXUSBDevice deviceInfo);

void *APICALL XSTDUSB_API_PREFIX(opendevice)(PXUSBDevice usbDevice);

int APICALL XSTDUSB_API_PREFIX(closedevice)(void *handle);

#ifdef __ANDROID__
    void *APICALL XSTDUSB_API_PREFIX(opendevice_fd)(int vid, int pid, int busNum, int dev_address, int fd);
    void *APICALL XSTDUSB_API_PREFIX(opendevice_usbhost)(JavaVM *jvm, JNIEnv *env, jobject obj);
    int APICALL XSTDUSB_API_PREFIX(closedevice_usbhost)(JavaVM *jvm, JNIEnv *env, void *handle);
#endif

int APICALL XSTDUSB_API_PREFIX(controltransfer)(void *handle, unsigned char bmRequestType, unsigned char bRequest, unsigned short wValue, unsigned short wIndex,
                                                unsigned char *data, unsigned short wLength, unsigned int timeout);
int APICALL XSTDUSB_API_PREFIX(transferwrite)(void *handle, unsigned char *data, int length, int *transferred, unsigned int timeout);
int APICALL XSTDUSB_API_PREFIX(transferread)(void *handle, unsigned char *data, int length, int *transferred, unsigned int timeout);
void APICALL XSTDUSB_API_PREFIX(resetdevice)(void *handle);

int APICALL  XSTDUSB_API_PREFIX(getserial)(void *handle, char *serial, int size);
int APICALL  XSTDUSB_API_PREFIX(getmodel)(void *handle,  unsigned char *buffer, int size);
int APICALL  XSTDUSB_API_PREFIX(getmanufacturer)(void *handle,  unsigned char *buffer, int size);
int APICALL  XSTDUSB_API_PREFIX(get_vid_pid_rev)(void *handle, int *nVID, int *nPID, int *nREV);

XUDC_API_END

#endif